package com.atguigu.gmall.order.service;


import com.atguigu.gmall.model.cart.CartItem;
import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.model.to.order.OrderCreateTo;
import com.atguigu.gmall.model.to.ware.WareOrderTo;
import com.atguigu.gmall.model.to.ware.WareSplitVo;
import com.atguigu.gmall.model.to.ware.WareStockStatusTo;
import com.atguigu.gmall.model.vo.order.OrderConfirmVo;
import com.atguigu.gmall.model.vo.order.OrderSubmitVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 *
 */
public interface OrderInfoService extends IService<OrderInfo> {
    //生成确认订单信息
    OrderConfirmVo orderConfirm();

    Long submitOrder(String tradeNo, OrderSubmitVo orderSubmitVo);

    @Transactional
    Long saveOrder(OrderSubmitVo orderSubmitVo, String tradeNo);



    //订单交易编号（第三方支付用)
    String generateOutTradeNo(Long userId);

    //获取用户购物车中勾选的购物车项
    List<CartItem> getCheckedCartItems(Long userId);
    //消费mq消息,关闭订单
    void closeOrder(OrderCreateTo orderCreateTo);

    OrderInfo infoById(Long orderId);
    //更新订单状态为已支付
    void updateOrderStatusToPaid(String outTradeNo);
    //根据支付宝的订单号查询订单状态并更新订单状态
    void checkOrderStatusByAliPay(String outTradeNo);

    WareOrderTo prepareWareOrderTo(String outTradeNo);

    List<WareOrderTo> splitOrder(WareSplitVo wareSplitVo1); //拆单

    void updateOrderStatusByStock(WareStockStatusTo wareStockStatusTo);
}
